package aqr;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.Random;

public class FileRunner implements Runnable {

	public void createFiles() {
		try {
			OutputStream fos = null;
			BufferedWriter bw = null;
			Random rand = new Random();
			StringBuilder sb = new StringBuilder("");
			for (int i = 1; i <= 3; i++) {
				fos = new FileOutputStream("C:/Temp/FileRunnerRepo/temp"+System.currentTimeMillis()+i+".txt");
				bw = new BufferedWriter(new OutputStreamWriter(fos));
				
				for (int j = 0; j < 100000; j++) {
					for (int k = 0; k < 300; k++) {
						sb.append(Character.toChars(rand.nextInt(25) + 65));
					}
					bw.write(sb.toString() + "\n");
					sb.setLength(0);
				}
				bw.close();
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void run() {
		this.createFiles();
	}
	
}
